home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 42 / Amiga Format AFCD42 (Issue 126, Aug 1999).iso / -serious- / programming / arexx / rxcmanager / examples / cmload.rexx < prev    next >
OS/2 REXX Batch file  |  1999-05-25  |  921b  |  48 lines

  1. /* */
  2.  
  3. parse arg user
  4.  
  5. signal on break_c
  6.  
  7. l="rxcmanager.library";if ~show("L",l) then;if ~addlib(l,0,-30) then exit
  8. l="rmh.library";if ~show("L",l) then;if ~addlib(l,0,-30) then exit
  9.  
  10. if user ~="" then do
  11.     userData = getUserData(user)
  12.     if userData="" then do
  13.         say "No data for user '"user"'"
  14.         exit
  15.     end
  16.     call CMLoad(userData)
  17. end
  18.  
  19. num = CMFind("USER WWW","REC",,1)
  20. if num=0 then do
  21.     say "No entry found for '"key"'"
  22.     exit
  23. end
  24.  
  25. say "Found" num "entry:"
  26. do i=0 to num-1
  27.     say
  28.     say "Type:     " rec.i.Type
  29.     say "Name:     " rec.i.Name
  30.     say "WWW:      " rec.i.WWW
  31.     say "Comment:  " rec.i.Comment
  32.     if rec.i.Type="WWW" then say "WebMaster:" rec.i.WebMaster
  33.     say "EMail:    " rec.i.EMail
  34. end
  35. exit
  36.  
  37. getUserData:
  38. parse arg user
  39.     CMPath = GetVar("vapor/cmanager_path")
  40.     if CMPath~="" then do
  41.         userData=AddPart(AddPart(PathPart(CMPath),user),user)".data"
  42.         if exists(userData) then return userData
  43.     end
  44.     return ""
  45.  
  46. break_c:
  47.     exit
  48.